Gestalt function

Syntax
Gestalt selector [, bit]

Description
Returns information about the hardware and system software configuration. You can use Gestalt to find out if a particular hardware or software component is available. Gestalt is based on the Macintosh toolbox call of the same name.

Selector is a four-character string that identifies the category of information you want to retrieve. Use the optional bit specifier (0–31) to get an individual bit in the result code as a True (1) or False (0) value.

An Apple-defined selector codes fall into two categories: environmental selectors, which supply specific environmental information you can use to control the behavior of your script, and informational selectors, which supply information you can’t use to determine what hardware or software features are available. You can use one of the selector codes defined by Apple (listed in the “Constants” section beginning on page 1-14 of Inside Macintosh: Operating System Utilities) or a selector code defined by a third-party product.

Examples
If (Gestalt "kbd ") = 4 
     Message "You are using an Extended keyboard"
Else
     Message "You are not using an Extended keyboard"
End If

If Gestalt "ascr", 0
     Message "AppleScript is available."
End If

If Gestalt "drag", 0
     Message "Drag and Drop support is available."
End If

If Gestalt "fndr", 3
     Message "OSL Compliant Finder is running."
End If

See Also
Inside Macintosh: Operating System Utilities, page 1–31